# import os
#
# from core.report import *
# from core.adbConnect import *
#
# from core.utils.file_utils import  *
# from core.utils.data_utils import *
#
# report = Report()
#
# current_path = get_current_file_path()
# data = get_config_path(
#     current_path,
#     load_yaml(os.path.join(current_path + r'/config/data.yaml'))
# )
#
# ReportPath = data['ReportPath']
# # {'TestApkPath': 'D:\\code\\project\\oneTap\\data/test_apk', 'OtherApkPath': 'D:\\code\\project\\oneTap\\data/other_apk'}
# test_apk_list = walk_apk_dir(data['TestApkPath'])
# other_apk_list = walk_apk_dir(data['OtherApkPath'])
#
# test_single_apk_list, test_multi_apk_list = test_apk_list[0], test_apk_list[1:]
#
# adb = AdbDevices()
# for apk in test_single_apk_list:
#     res = adb.install_single_apk(apk)
#     report.add_record(get_apk_single_name(res))
#
# for apk_list in test_multi_apk_list:
#     res = adb.install_multiple_apk(apk_list)
#     report.add_record(get_apk_multi_name(res))
#
# other_single_apk_list, other_multi_apk_list = other_apk_list[0], other_apk_list[1:]
#
# for apk in other_single_apk_list:
#     res = adb.install_single_apk(apk)
#     report.add_record(get_apk_single_name(res))
#
# for apk_list in other_multi_apk_list:
#     res = adb.install_multiple_apk(apk_list)
#     report.add_record(get_apk_multi_name(res))
#
# report.create_report(os.path.join(current_path, ReportPath))

import uiautomator2 as u2
d = u2.connect()

print(d(text="同意").exists(timeout=2.0))
